<!DOCTYPE html>
<html lang="zh">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/header :: header(~{::title},~{::link},~{})">
    <link rel="icon" th:href="@{/assets/img/lcxm.ico}" type="image/ico">
    <link rel="stylesheet" th:href="@{/css/style.css}">
</head>
<body style="margin-bottom: 60px;">

<div class="row">
    <div class="col-sm-12 col-md-12 col-xs-12">

        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    上传文件
                </h3>
            </div>

            <div class="panel-body">
                <div th:if="${remind}" class="alert alert-${ remind.level  }"
                     th:classappend="'alert-' + ${remind.level}">
                    <button data-dismiss="alert" class="close" type="button">
                        <i class="glyphicon glyphicon-remove"></i>
                    </button>
                    <span th:remove="tag" th:utext="${ remind.message }"></span>
                </div>

                <form role="form" class="form-horizontal" th:action="@{/student/upload}" enctype="multipart/form-data"
                      method="post">

                    <div class="form-group">
                        <label for="studentno" class="col-sm-2 col-xs-2 control-label">学号*</label>
                        <div class="ccol-sm-9 col-xs-9 ">
                            <input type="text" class="form-control" id="studentno" name="studentno" placeholder="请输入学号"
                                   autocomplete="off"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="file" class="col-sm-2 col-xs-2 control-label">图片*</label>
                        <div class="col-sm-9 col-xs-9">
                            <input type="file" class="" name="file" id="file"/>
                        </div>
                    </div>


                    <div class="form-group">
                        <div class="col-sm-offset-2 col-xs-offset-2 col-sm-10 col-xs-10">
                            <button type="submit" class="btn btn-info submit">确认提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    已上传列表
                </h3>
            </div>
            <div class="panel-body">
                <ul class="list-group">
                    <li class="list-group-item" th:each="item:${files}">
                        <span>
                            <span th:text="${(itemStat.index + 1)+'. '}"></span>
                            <a href="javascript:;" th:text="${item.name}">文件名</a>
                        </span>
                        <span th:text="'大小:'+ ${item.size} + 'KB'" style="margin-left:10px;"></span>
                        <img th:src="@{'/zbl-attach/' + ${item.name}}" class="pop" style="height: 1.7em;" alt="非图片">
                        <a th:if="${session.zbl}" class="btn btn-sm btn-danger" th:href="@{'/student/delete/' + ${item.name}}"  style="margin-left:10px;">删除</a>
                    </li>
                </ul>

            </div>
        </div>

        <hr/>

        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    老师专用
                </h3>
            </div>
            <div class="panel-body">
                <form th:if="${session.zbl == null or not session.zbl}" role="form" class="form-horizontal" th:action="@{/student/login}"
                      method="post">

                    <div class="form-group">
                        <label for="password" class="col-sm-2 col-xs-2 control-label">密码*</label>
                        <div class="ccol-sm-9 col-xs-9 ">
                            <input type="text" class="form-control" id="password" name="password" placeholder="下载密码"
                                   autocomplete="off"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-offset-2 col-xs-offset-2 col-sm-10 col-xs-10">
                            <button type="submit" class="btn btn-info submit">确认登录</button>
                        </div>
                    </div>
                </form>
                <div th:if="${session.zbl}">
                     <a class="btn btn-info" th:href="@{/student/downloads}" th:text="下载全部"></a>
                     <a class="btn btn-primary" th:href="@{/student/logout}" th:text="退出"></a>
                </div>


            </div>
        </div>

    </div>
</div>
</div>

<!-- 引入通用js-->
<div th:replace="common/footer :: footer"></div>
<script th:src="@{/js/TagCloud.min.js}"></script>
<script>

</script>

</body>
</html>